package com.prs.crm.service.doc.impl;

import java.io.File;

import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.doc.FormworkDao;
import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.doc.Formwork;
import com.prs.crm.service.doc.FormworkService;
import com.prs.crm.service.impl.BaseServiceImpl;

public class FormworkServiceImpl extends BaseServiceImpl<Formwork,FormworkDao> implements FormworkService{

	@Override
	public void saveFormwork(Formwork formwork, File file, String fileName) {
		// TODO Auto-generated method stub
		Attachment attach = FileUtil.getInstance().createAttach(file, fileName);
		if(attach != null) {
			formwork.setAttach(attach);
		}
		this.getDao().save(formwork);
	}

}
